
<div ng-controller="InternalCollarCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li >配件报表</li>
			<li class="active" ng-hide="menuName">配件内部领用统计</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/partsInvoicing/internalcollar/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/partsInvoicing/internalcollar/')"><i class="fa fa-star"></i> 收藏 </span>
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件内部领用统计

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()"
								style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()"
								style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="group_name"  ng-keyup="clearGroup()" name="group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  ng-keyup="clearGroupBrand()" name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" name="entity_name" ng-keyup="clearGroupBrandEntity()" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" ng-click='LoadEntityLevel(e)' val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="partno" class="form-control form_params" />
									</div>
								</div>
							</div>
							
							
							<!-- 日期-->
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" >日期</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											<input type="text" name="finishedDate1" class="form-control form_params" id="finishedDate1" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'finishedDate2\')||\'2020-10-01\'}'})">
											
										</div>
									</div>
								</div>
							</div>
                            
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" >至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class=" input-large custom-date-range">
											 <input type="text" name="finishedDate2" class="form-control form_params" id="finishedDate2" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'finishedDate1\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">二级类别</label>
									<div class="col-lg-8 col-sm-7">
                                            <select name="subgroupname" class="form-control form_params" ng-model="subGroupName"  ng-change="loadThird(subGroupName)" >
												<option></option>
												<option   ng-repeat="b in sub_list" value="{{b.name}}" val_code="{{b.code}}">{{b.name}}</option>
										    </select>
                                    </div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">三级类别</label>
									<div class="col-lg-8 col-sm-7">
									       <select name="thirdgroupname" class="form-control form_params" ng-model="thirdGroupName" ng-change="loadFourth(thirdGroupName)" >
												<option></option>
												<option   ng-repeat="b in third_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">四级类别</label>
									<div class="col-lg-8 col-sm-7">
										    <select name="fourthgroupname" class="form-control form_params" >
										 		<option></option>
												<option  ng-repeat="b in fourth_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件名称</label>
									<div class="col-lg-8 col-sm-7">
										<input name="partname" class="form-control form_params" />
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">九大类</label>
									<div class="col-lg-8 col-sm-7">
										<select name="partmaintype" class="form-control form_params">
											<option></option>
											<option  ng-selected="b.status_code==selected.statusdispatched" ng-repeat="b in partmain_list" value="{{b.status_code}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件内部领用统计
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>
					
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="cotyTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index_id')" column="index_id">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('group_name')" column="group_name">事业部</th>
										<th ng-show="!cols.contains('receiptno')" column="receiptno">领用单号</th>
										<th ng-show="!cols.contains('receiptorname')" column="receiptorname">领用人</th>
<!-- 										<th qtype='date' ng-show="!cols.contains('finisheddate')" column="finisheddate">日期</th> -->
										<th ng-show="!cols.contains('storagename')" column="storagename">仓库</th>
										<th ng-show="!cols.contains('positionname')" column="positionname">库位</th>
										<th ng-show="!cols.contains('partno')" column="partno">配件代码</th>
										<th ng-show="!cols.contains('partname')" column="partname">配件名称</th>
										<th ng-show="!cols.contains('subgroupname')" column="subgroupname">二级类别</th>
										<th ng-show="!cols.contains('thirdgroupname')" column="thirdgroupname">三级类型</th>
										<th ng-show="!cols.contains('fourthgroupname')" column="fourthgroupname">四级类别</th>
										<th ng-show="!cols.contains('unit')" column="unit">计量单位</th>
										<th qtype='float' ng-show="!cols.contains('outquantity')" column="outquantity">出库数量</th>
										<th qtype='float' ng-show="!cols.contains('costprice')" column="costprice">成本单价</th>
										<th qtype='float' ng-show="!cols.contains('costamount')" column="costamount">成本金额</th>
										<th qtype='float' ng-show="!cols.contains('outprice')" column="outprice">出库单价</th>
										<th qtype='float' ng-show="!cols.contains('outamount')" column="outamount">出库金额</th>
										<th ng-show="!cols.contains('remark')" column="remark">备注</th>
										<th ng-show="!cols.contains('partmaintype')" column="partmaintype">九大类</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in partsInvo">
										<td ng-show="!cols.contains('index_id')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" column="entity_code">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" column="entity_name">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('group_name')" column="group_name">{{c.group_name}}</td>
										<td ng-show="!cols.contains('receiptno')" column="receiptno">{{c.receiptno}}</td>
										<td ng-show="!cols.contains('receiptorname')" column="receiptorname">{{c.receiptorname}}</td>
<!-- 										<td qtype='date' ng-show="!cols.contains('finisheddate')" column="finisheddate">{{c.finisheddate |date : 'yyyy-MM-dd HH:mm:ss'}}</td> -->
										<td ng-show="!cols.contains('storagename')" column="storagename">{{c.storagename}}</td>
										<td ng-show="!cols.contains('positionname')" column="positionname">{{c.positionname}}</td>
										<td ng-show="!cols.contains('partno')" column="partno">{{c.partno}}</td>
										<td ng-show="!cols.contains('partname')" column="partname">{{c.partname}}</td>
										<td ng-show="!cols.contains('subgroupname')" column="subgroupname">{{c.subgroupname}}</td>
										<td ng-show="!cols.contains('thirdgroupname')" column="thirdgroupname">{{c.thirdgroupname}}</td>
										<td ng-show="!cols.contains('fourthgroupname')" column="fourthgroupname">{{c.fourthgroupname}}</td>
										<td ng-show="!cols.contains('unit')" column="unit">{{c.unit}}</td>
										<td qtype='float' ng-show="!cols.contains('outquantity')" column="outquantity">{{c.outquantity|number:2}}</td>
										<td qtype='float' ng-show="!cols.contains('costprice')" column="costprice">{{c.costprice|number:4}}</td>
										<td qtype='float' ng-show="!cols.contains('costamount')" column="costamount">{{c.costamount|number:2}}</td>
										<td qtype='float' ng-show="!cols.contains('outprice')" column="outprice">{{c.outprice|number:4}}</td>
										<td qtype='float' ng-show="!cols.contains('outamount')" column="outamount">{{c.outamount|number:2}}</td>
										<td ng-show="!cols.contains('remark')" column="remark">{{c.remark}}</td>
										<td ng-show="!cols.contains('partmaintype')" column="partmaintype">{{c.partmaintype}}</td>
									</tr>
									
									
									<tr class="tbody_last_tr" ng-show="pagination.totalItems >0">
										<td ng-show="!cols.contains('index_id')" class=""></td>
										<td ng-show="!cols.contains('entity_code')" column="entity_code"></td>
										<td ng-show="!cols.contains('entity_name')" column="entity_name"></td>
										<td ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name"></td>
										<td ng-show="!cols.contains('group_name')" column="group_name"></td>
										<td ng-show="!cols.contains('receiptno')" column="receiptno"></td>
										<td ng-show="!cols.contains('receiptorname')" column="receiptorname"></td>
<!-- 										<td qtype='date' ng-show="!cols.contains('finisheddate')" column="finisheddate">{{c.finisheddate |date : 'yyyy-MM-dd HH:mm:ss'}}</td> -->
										<td ng-show="!cols.contains('storagename')" column="storagename"></td>
										<td ng-show="!cols.contains('positionname')" column="positionname"></td>
										<td ng-show="!cols.contains('partno')" column="partno"></td>
										<td ng-show="!cols.contains('partname')" column="partname"></td>
										<td ng-show="!cols.contains('subgroupname')" column="subgroupname"></td>
										<td ng-show="!cols.contains('thirdgroupname')" column="thirdgroupname"></td>
										<td ng-show="!cols.contains('fourthgroupname')" column="fourthgroupname"></td>
										<td ng-show="!cols.contains('unit')" column="unit">{{c.unit}}</td>
										<td qtype='float' ng-show="!cols.contains('outquantity')" column="outquantity"></td>
										<td qtype='float' ng-show="!cols.contains('costprice')" column="costprice"></td>
										<td qtype='float' ng-show="!cols.contains('costamount')" column="costamount">{{partsInvoSum.sum_costamount.value|number:2}}</td>
										<td qtype='float' ng-show="!cols.contains('outprice')" column="outprice"></td>
										<td qtype='float' ng-show="!cols.contains('outamount')" column="outamount">{{partsInvoSum.sum_outamount.value|number:2}}</td>
										<td ng-show="!cols.contains('remark')" column="remark"></td>
										<td ng-show="!cols.contains('partmaintype')" column="partmaintype"></td>
									</tr>
									</tr>

								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>

						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
	 
</div>

<form id="export_form" action="internalCollar/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="配件内部领用统计"/>
</form>
